package com.bwie.controller;

import com.bwie.pojo.TbBrand;
import com.bwie.service.TbBrandService;
import com.bwie.utils.R;
import com.bwie.vo.PageInfoVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 牛毅
 * @version 1.0
 * @date 2025/7/19
 * @description TODO
 */
@RestController
@RequestMapping("/prod/brand")
public class BrandController {
    @Autowired
    TbBrandService tbBrandService;

    /**
     * @description: 获取品牌列表
     * @param: pageInfoVo
     * @return: com.bwie.utils.R
     * @author 牛毅
     * @date: 2025/7/20 20:52
     */
    @PostMapping("/getBrandList")
    public R getBrandList(@RequestBody PageInfoVo pageInfoVo){
        return tbBrandService.getBrandList(pageInfoVo);
    }

    /**
     * @description: 添加品牌
     * @param: tbBrand
     * @return: com.bwie.utils.R
     * @author 牛毅
     * @date: 2025/7/20 20:53
     */
    @PostMapping("/addBrand")
    public R addBrand(@RequestBody TbBrand tbBrand){
        return tbBrandService.addBrand(tbBrand);
    }

    /**
     * @description: 修改品牌
     * @param: tbBrand
     * @return: com.bwie.utils.R
     * @author 牛毅
     * @date: 2025/7/20 20:53
     */
    @PostMapping("/updateBrand")
    public R updateBrand(@RequestBody TbBrand tbBrand){
        return tbBrandService.updateBrand(tbBrand);
    }

}
